# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-persistent
pkgver=5.1
pkgrel=1
pkgdesc="Translucent persistent objects"
arch=('loong64' 'x86_64')
license=('ZPL')
url="https://github.com/zopefoundation/persistent/"
depends=('python-cffi' 'python-zope-interface')
makedepends=('python-setuptools')
checkdepends=('python-zope-testrunner' 'python-manuel')
source=("https://github.com/zopefoundation/persistent/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('1dfeefa0437d37b075b9fdbec7a2e7cc8e7bb665b46e384204bf922fe13fc4280a6e0b419d97c9899725db478ac8589ed7f22887f267e58f418baa26f921e318')

build() {
  cd persistent-$pkgver
  python setup.py build
}

check() {
  cd persistent-$pkgver
  python -m venv "$srcdir/pyvenv" --system-site-packages
  (
    . "$srcdir/pyvenv/bin/activate"
    python setup.py develop
    python -m zope.testrunner --test-path=src
  )
}

package() {
  cd persistent-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
}
